'''
Author: your name
Date: 2021-03-17 11:20:06
LastEditTime: 2021-11-06 22:05:48
LastEditors: Please set LastEditors
Description: In User Settings Edit
FilePath: /tinyms/tinyms-api/apps/auth/test/menuDto.py
MenuDto 为前端显示类型
Menu 为数据库中的字段类型
subMenus 为菜单的子菜单集合
'''
from .model import Channel
class ChannelDto():
    def __init__(self, Channel, subs):
        super().__init__()
        if Channel is not None:
            self.channel_pk = Channel.channel_pk
            self.channel_name = Channel.channel_name
            self.channel_parent = Channel.channel_parent
            self.channel_english = Channel.channel_english
            self.channel_path = Channel.channel_path 
            self.channel_content_template = Channel.channel_content_template 
            self.channel_page_template = Channel.channel_page_template 
            self.channel_page_count = Channel.channel_page_count 
            self.channel_list_template = Channel.channel_list_template 
            self.channel_list_count = Channel.channel_list_count 
            self.channel_state = Channel.channel_state 
        elif subs is not None:
            self.children = subs

    def __str__(self):
        return '%s(channel_pk=%s,channel_name=%s,channel_parent=%s,channel_english=%s,channel_path=%s)' % (
            self.__class__.__name__, self.channel_pk, self.channel_name, self.channel_parent, self.channel_english, self.channel_path)

    __repr = __str__